package java基础.array;

/**
 * @author IT_Jay
 * @date 2022/1/16 21:03
 */

public class arrayDemo01 {
    public static void main(String[] args) {
        int[] nums = new int[10];
        int sum = 0;
        for (int i = 0; i < nums.length; i++) {
            nums[i]=i;
            System.out.println(nums[i]);
            sum += nums[i];
        }
        System.out.println(nums[9]);
        System.out.println("数组内数据元素和为："+sum);
    }
}
